$OpenBSD: patch-lib_rubygems_version_rb,v 1.1 2014/01/06 02:24:49 jeremy Exp $

Backport fix for CVE-2013-4287 and CVE-2013-4363.

--- lib/rubygems/version.rb.orig	Sun Dec  1 15:40:49 2013
+++ lib/rubygems/version.rb	Sun Dec  1 15:40:51 2013
@@ -145,8 +145,8 @@ class Gem::Version
 
   include Comparable
 
-  VERSION_PATTERN = '[0-9]+(\.[0-9a-zA-Z]+)*' # :nodoc:
-  ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})*\s*\z/ # :nodoc:
+  VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*' # :nodoc:
+  ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/ # :nodoc:
 
   ##
   # A string representation of this Version.
